package com.woniu.woniuproject.controller.admin;
import com.github.pagehelper.PageInfo;
import com.woniu.woniuproject.entity.Product;
import com.woniu.woniuproject.service.ProductService;
import com.woniu.woniuproject.utils.ResponseResult;
import com.woniu.woniuproject.vo.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController//处理http请求用来响应页面
@RequestMapping("Product")
public class ProductController {
    @Autowired
    ProductService productService;
    @GetMapping("/query")
    public ResponseResult<PageInfo<Product>> queryByDate(Page page){

        PageInfo<Product> productPageInfo = productService.queryProductPage(page);
        return new ResponseResult<>(productPageInfo);
    }

}
